package com.ship.dispatch.bean;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ship.common.core.annotation.Excel;
import com.ship.common.core.base.Joinable;
import com.ship.common.core.mapping.TableColumn;
import com.ship.common.core.validate.Add;
import com.ship.dispatch.util.NumberFormatUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 燃油台账加油记录信息
 * @TableName tz_fuel_report
 */
@TableName(value ="tz_fuel_report")
@Data
public class TzFuelReport extends BaseBean implements Joinable {

    /**
     * 船舶名称
     */
    @TableColumn
    @ApiModelProperty(value = "船舶名称",required = true)
    @NotBlank(message = "船舶名称不能为空",groups = Add.class)
    @ExcelProperty({"船舶名称"})
    private String shipName;

    /**
     * 船舶IMO
     */
    @TableColumn
    @ApiModelProperty(value = "船舶IMO",required = true)
    @NotBlank(message = "船舶IMO不能为空",groups = Add.class)
    @ExcelProperty({"船舶IMO"})
    private String imo;

    /**
     * 加油时间
     */
    @TableColumn
    @ApiModelProperty(value = "加油时间",required = true)
    @NotNull(message = "加油时间不能为空",groups = Add.class)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @ExcelProperty({"加油时间"})
    private Date fuelTime;

    /**
     * 枚举：燃油加注、交船结算
     */
    @TableColumn
    @ApiModelProperty(value = "枚举：燃油加注、交船结算")
    @ExcelProperty({"加油类型"})
    private String fuelType;

    /**
     * 加油合同名称
     */
    @TableColumn
    @ApiModelProperty(value = "加油合同名称")
    @ExcelProperty({"加油合同名称"})
    private String contractName;

    /**
     * 加油合同ID
     */
    @ApiModelProperty(value = "加油合同ID")
    @ExcelIgnore
    private Long contractId;

    /**
     * 数据类型（1：手动新增，2：交还船结算）
     */
    @ApiModelProperty(value = "数据类型（1：手动新增，2：交还船结算）")
    @ExcelIgnore
    private Integer dataType;

    /**
     * 删除审批状态（0：待审核，1：已通过，2：未通过）
     */
    @ApiModelProperty(value = "删除审批状态（0：待审核，1：已通过，2：未通过）")
    @ExcelIgnore
    private Integer approvalStatus;

    /**
     * 支付订单id
     */
    @ApiModelProperty(value = "支付订单id")
    @ExcelIgnore
    private Long orderId;

    /**
     * 支付订单详情id
     */
    @ApiModelProperty(value = "支付订单详情id")
    @ExcelIgnore
    private Long orderDetailId;

    /**
     * VLSFO加油量（吨）
     */
    @TableColumn
    @ApiModelProperty(value = "VLSFO加油量（吨）")
    @ExcelIgnore
    private BigDecimal vlsfoValue;

    /**
     * VLSFO油价（美元/吨）
     */
    @TableColumn
    @ApiModelProperty(value = "VLSFO油价（美元/吨）")
    @ExcelIgnore
    private BigDecimal vlsfoPrice;

    /**
     * LSMGO加油量（吨）
     */
    @TableColumn
    @ApiModelProperty(value = "LSMGO加油量（吨）")
    @ExcelIgnore
    private BigDecimal lsmgoValue;

    /**
     * LSMGO油价（美元/吨）
     */
    @TableColumn
    @ApiModelProperty(value = "LSMGO油价（美元/吨）")
    @ExcelIgnore
    private BigDecimal lsmgoPrice;

    /**
     * VLSFO加油量（吨）
     */
    @TableColumn
    @TableField(exist = false)
    @ApiModelProperty(value = "VLSFO加油量（吨）")
    @ExcelProperty({"VLSFO加油量（吨）"})
    private String vlsfoValueStr;

    /**
     * VLSFO油价（美元/吨）
     */
    @TableColumn
    @TableField(exist = false)
    @ApiModelProperty(value = "VLSFO油价（美元/吨）")
    @ExcelProperty({"VLSFO油价（美元/吨）"})
    private String vlsfoPriceStr;

    /**
     * LSMGO加油量（吨）
     */
    @TableColumn
    @TableField(exist = false)
    @ApiModelProperty(value = "LSMGO加油量（吨）")
    @ExcelProperty({"LSMGO加油量（吨）"})
    private String lsmgoValueStr;

    /**
     * LSMGO油价（美元/吨）
     */
    @TableColumn
    @TableField(exist = false)
    @ApiModelProperty(value = "LSMGO油价（美元/吨）")
    @ExcelProperty({"LSMGO油价（美元/吨）"})
    private String lsmgoPriceStr;

    /**
     * 燃油供应商
     */
    @TableColumn
    @ApiModelProperty(value = "燃油供应商")
    @ExcelProperty({"加油供应商"})
    private String fuelSupplier;

    /**
     * 附件信息
     */
    @TableColumn
    @ApiModelProperty(value = "附件信息")
    @ExcelIgnore
    private String fileInfo;

    @ApiModelProperty(value = "附件下载地址信息")
    @ExcelIgnore
    private String filePathInfo;

    /**
     * 操作人
     */
    @TableColumn
    @ApiModelProperty(value = "操作人")
    @ExcelIgnore
    private String updatedBy;

    @ApiModelProperty(value = "数据类型（1：量1，2：量2，3：量3）")
    @ExcelIgnore
    private Integer valueType;

    /**
     * 操作时间
     */
    @TableColumn
    @ApiModelProperty(value = "操作时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date updatedTime;

    /**
     * 流程实例Id
     */
    @ApiModelProperty(value = "流程实例Id")
    @ExcelIgnore
    private String processInstanceId;

    @Override
    public String getLabel() {
        return null;
    }

    @Override
    public String getValue() {
        return null;
    }

    public String getVlsfoValueStr(){
        String result = null;
        if (getVlsfoValue() != null) {
            result = NumberFormatUtil.numericFormatting(getVlsfoValue());
        }
        return result;
    }

    public String getVlsfoPriceStr(){
        String result = null;
        if (getVlsfoPrice() != null) {
            result = NumberFormatUtil.numericFormatting(getVlsfoPrice());
        }
        return result;
    }

    public String getLsmgoValueStr(){
        String result = null;
        if (getLsmgoValue() != null) {
            result = NumberFormatUtil.numericFormatting(getLsmgoValue());
        }
        return result;
    }

    public String getLsmgoPriceStr(){
        String result = null;
        if (getLsmgoPrice() != null) {
            result = NumberFormatUtil.numericFormatting(getLsmgoPrice());
        }
        return result;
    }
}